//①引入
import Vue from 'vue'
import VueRouter from 'vue-router'
//组件
import HomeVue from '@/views/HomeVue.vue'
import NewsVue from '@/views/NewsVue.vue'
import Sports from '@/views/SportsVue.vue'
//导入二级路由
import Sportss from '@/views/Sportss.vue'
import Sportsss from '@/views/Sportsss.vue'
import Sportssss from '@/views/Sportssss.vue'
//② 调用Vue.use() 去注册插件
Vue.use(VueRouter)
    //③ 创建路由实例
const router = new VueRouter({
        routes: [{
                path: '/home',
                component: HomeVue
            },
            {
                path: '/news',
                component: NewsVue
            },
            {
                path: '/sports',
                component: Sports,
                children: [{
                        path: 'sportss/:uname',
                        component: Sportss
                    },
                    {
                        path: 'sportsss',
                        component: Sportsss
                    }, {
                        path: 'sportssss',
                        component: Sportssss
                    },
                ]
            },
        ]
    })
    //对外暴露路由实例
export default router